'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
/* eslint-disable */
exports.default = {
  bind: function bind(el, binding) {
    var self = arguments[1].def;
    var config = self.$options.point;
    var trigger = el.getAttribute('data-buryingPointTrigger') || 'click';
    self.data = binding.value;
    el.addEventListener(trigger, function (e) {
      var params = {
        trigger: trigger,
        dom: e.target,
        raw: self.data,
        id: e.target.id,
        className: e.target.className,
        path: window.location.href
        // 浏览器信息和电脑信息通过http可获取
      };
      config.http.get(config.url, { params: params }).then(function () {
        if (config.debug) {
          console.log(params);
        }
      });
    });
  },
  update: function update(el, binding) {
    var self = arguments[1].def;
    self.data = binding.value;
  }
};